package com.arcsoft.commonbase.ext

import android.content.Context
import android.graphics.Color
import android.view.Gravity
import android.widget.Toast
import com.arcsoft.commonbase.R
import com.arcsoft.commonbase.widgets.ProgressDialogVer
import com.blankj.utilcode.util.ToastUtils

/**
 * ToastUtils配置统一风格
 */
fun customToast(): ToastUtils {
    return ToastUtils.make()
        .setBgResource(R.drawable.common_toast_shape_bg)
        .setTextColor(Color.WHITE)
        .setDurationIsLong(true)
        .setGravity(Gravity.CENTER, 0, 0)
}

/**
 * 短toast提示
 */
fun showShortToast(msg: String) {
    customToast().show(msg)
}

/**
 * 短toast提示
 */
fun customShowLong(msg: String?) {
    customToast().show(msg)
}

fun showLoadingDialog(context: Context, cancelable:Boolean = true): ProgressDialogVer {
    return ProgressDialogVer.show(context, "", "", true, cancelable)
}